package com.lonely.web.controller.purchase;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.lonely.common.core.domain.TimeLine;
import com.lonely.common.core.domain.api.R;
import com.lonely.purchase.service.IRemainingMaterialInventoryLogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : 黄志标
 * @date: 2025/7/25 16:21
 * @description: 余料库存日志请求处理器
 */
@RestController
@RequestMapping("/purchaseManager/remainingMaterialInventoryLog")
@Api(tags = "采购管理/余料库存日志")
public class RemainingMaterialInventoryLogController {

    @Autowired
    private IRemainingMaterialInventoryLogService remainingMaterialInventoryLogService;

    /**
     * 获取余料库存日志时间线
     *
     * @param inventoryId
     * @return
     */
    @GetMapping("/getLogTimeLine/{inventoryId}")
    @SaCheckPermission("purchase:remainingMaterialInventory:log")
    public R<List<TimeLine>> getLogTimeLine(@PathVariable("inventoryId") Long inventoryId) {
        return R.data(this.remainingMaterialInventoryLogService.getLogTimeLine(inventoryId));
    }
}
